import request from './request'

const baseUrlApi = 'https://fhxxg.fanglilai.cn/'
const baiduApi = 'http://api.map.baidu.com/'

const api = {
  // ------ baidu ------
  geocoder: (latlng) => request.get('geocoder/v2/', {
    ak: 'OZxKzAsWW4w3A6q7EHKGU4OldPNrpQZo',
    location: latlng,
    output: 'json',
    pois: '1'
  }, {
    baseURL: baiduApi
  }),
  // --------------------------- accounts ---------------------------------------------------------------------------------------------------------------------------
  oplogin: (id, last) => request.post('apii/accounts/oplogin', {
    account: id,
    password: last
  }, {
    baseURL: baseUrlApi
  }),
  oploginenterprise: (id, last) => request.post('apii/accounts/oploginenterprise', {
    account: id,
    password: last
  }, {
    baseURL: baseUrlApi
  }),
  opsentmsgcode: (cellphone, type, code) => request.post('apii/accounts/opsentmsgcode', {
    'cellphone': cellphone,
    'msg_code_type': type,
    'captcha_code': code
  }, {
    baseURL: baseUrlApi
  }),
  opregister: (cellphone, password, code, type) => request.post('apii/accounts/opregister', {
    'cellphone': cellphone,
    'password': password,
    'msg_code': code,
    'msg_code_type': type
  }, {
    baseURL: baseUrlApi
  }),
  opverifysmscode: (cellphone, code, type) => request.post('apii/accounts/opverifysmscode', {
    'cellphone': cellphone,
    'msg_code': code,
    'msg_code_type': type
  }, {
    baseURL: baseUrlApi
  }),
  opforgetpassword: (cellphone, password, password1) => request.post('apii/accounts/opforgetpassword', {
    'account': cellphone,
    'password': password,
    'password1': password1
  }, {
    baseURL: baseUrlApi
  }),
  // --------------------------- tenant
  opoauthaccount: (param) => request.post('apii/accounts/opoauthaccount', param, {
    baseURL: baseUrlApi
  }),
  opcontractlist: (param) => request.post('apii/usertenant/opcontractlist', param, {
    baseURL: baseUrlApi
  }),
  opcontractdetail: (param) => request.post('apii/usertenant/opcontractdetail', param, {
    baseURL: baseUrlApi
  }),
  opbilllist: (param) => request.post('/apii/usertenant/opbilllist', param, {
    baseURL: baseUrlApi
  }),
  opbilldetail: (param) => request.post('/apii/usertenant/opbilldetail', param, {
    baseURL: baseUrlApi
  }),
  opmeterlist: (param) => request.post('/apii/usertenant/opmeterlist', param, {
    baseURL: baseUrlApi
  }),
  opmeetingroomlist: (param) => request.post('/apii/userlandlord/opmeetingroomlist', param, {
    baseURL: baseUrlApi
  }),
  opmeetingorderslist: (param) => request.post('/apii/userlandlord/opmeetingorderslist', param, {
    baseURL: baseUrlApi
  }),
  opmeetingordersdetail: (param) => request.post('/apii/userlandlord/opmeetingordersdetail', param, {
    baseURL: baseUrlApi
  }),
  opnoticelist: (param) => request.post('/apii/message/opnoticelist', param, {
    baseURL: baseUrlApi
  }),
  opnoticedetail: (param) => request.post('/apii/message/opnoticedetail', param, {
    baseURL: baseUrlApi
  }),
  opmeterstatus: (param) => request.post('/apii/usertenant/opmeterstatus', param, {
    baseURL: baseUrlApi
  }),
  opmeterreading: (param) => request.post('/apii/usertenant/opmeterreading', param, {
    baseURL: baseUrlApi
  }),
  opmeetingrenttimebyday: (param) => request.post('/apii/userlandlord/opmeetingrenttimebyday', param, {
    baseURL: baseUrlApi
  }),
  opunionpaymakeorder: (param) => request.post('/apii/pay/opunionpaymakeorder', param, {
    baseURL: baseUrlApi
  }),
  opgetconfigwechatpayxcx: (param) => request.post('/apii/pay/opgetconfigwechatpayxcx', param, {
    baseURL: baseUrlApi
  }),
  opUnionpay: (param) => request.post('/apii/pay/opUnionpay', param, {
    baseURL: baseUrlApi
  }),
  opbindwechat: (param) => request.post('/apii/accounts/opbindwechat', param, {
    baseURL: baseUrlApi
  }),
  opgetuserinfo: (param) => request.post('/apii/accounts/opgetuserinfo', param, {
    baseURL: baseUrlApi
  }),
  opnoticedel: (param) => request.post('/apii/message/opnoticedel', param, {
    baseURL: baseUrlApi
  }),
  opBindCellphoneXcx: (param) => request.post('/apii/accounts/opBindCellphoneXcx', param, {
    baseURL: baseUrlApi
  }),
  opmeetingorderssave: (param) => request.post('/apii/userlandlord/opmeetingorderssave', param, {
    baseURL: baseUrlApi
  }),
  // --------------------------- home(enterprise) ---------------------------------------------------------------------------------------------------------------------------
  homefhxxg: (districtId) => request.post('apii/userlandlord/homefhxxg', {
    'district_id': districtId
  }, {
    baseURL: baseUrlApi
  }),
  oppropertymanagelist: (param) => request.post('apii/userlandlord/oppropertymanagelist', param, {
    baseURL: baseUrlApi
  }),
  // --------------------------- hardware -----------------------------------------------------------------------------
  ophardwarelistall: (param) => request.post('apii/userlandlord/ophardwarelistall', param, {
    baseURL: baseUrlApi
  }),
  ophardwarelist: (param) => request.post('apii/userlandlord/ophardwarelist', param, {
    baseURL: baseUrlApi
  }),
  ophardwareinfo: (param) => request.post('apii/userlandlord/ophardwareinfo', param, {
    baseURL: baseUrlApi
  }),
  oppropertymeterread: (param) => request.post('apii/userlandlord/oppropertymeterread', param, {
    baseURL: baseUrlApi
  }),
  oppropertymeterstatus: (param) => request.post('apii/userlandlord/oppropertymeterstatus', param, {
    baseURL: baseUrlApi
  }),
  oppropertymeterrecords: (param) => request.post('apii/userlandlord/oppropertymeterrecords', param, {
    baseURL: baseUrlApi
  }),
  opmeetingcreateorder: (param) => request.post('apii/meeting/opmeetingcreateorder', param, {
    baseURL: baseUrlApi
  }),
  // --------------------------- sector -----------------------------------------------
  openterprisesectorlist: (param) => request.post('apii/userlandlord/openterprisesectorlist', param, {
    baseURL: baseUrlApi
  }),
  openterprisestafflist: (param) => request.post('apii/userlandlord/openterprisestafflist', param, {
    baseURL: baseUrlApi
  }),
  openterprisesectorsave: (param) => request.post('apii/userlandlord/openterprisesectorsave', param, {
    baseURL: baseUrlApi
  }),
  openterprisesectordel: (param) => request.post('apii/userlandlord/openterprisesectordel', param, {
    baseURL: baseUrlApi
  }),
  openterprisesectoradd: (param) => request.post('apii/userlandlord/openterprisesectoradd', param, {
    baseURL: baseUrlApi
  }),
  openterprisestaffdel: (param) => request.post('apii/userlandlord/openterprisestaffdel', param, {
    baseURL: baseUrlApi
  }),
  openterprisestaffsave: (param) => request.post('apii/userlandlord/openterprisestaffsave', param, {
    baseURL: baseUrlApi
  }),
  openterprisestaffadd: (param) => request.post('apii/userlandlord/openterprisestaffadd', param, {
    baseURL: baseUrlApi
  }),
  // --------------------------- me ---------------------------------------------------------------------------------------------------------------------------
  opuserinfoget: () => request.post('apii/user/opuserinfoget', {}, {
    baseURL: baseUrlApi
  }),

  opuserinfosave: (param) => request.post('apii/user/opuserinfosave', param, {
    baseURL: baseUrlApi
  }),

  opsettingfeedback: (content, contact) => request.post('apii/user/opsettingfeedback', {
    'content': content,
    'contact': contact
  }, {
    baseURL: baseUrlApi
  }),
  opbalance: (id, last) => request.post('apii/user/opbalance', {
    account: id,
    password: last
  }, {
    baseURL: baseUrlApi
  })
}

export default api
